package com.odp.mapper;

import com.odp.entity.Subscribe;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface SubscribeMapper {
    public int addSubscribe(Subscribe subscribe);

    //确认是否已经关注过
    @Select("select * from t_subscribe where user_id=#{userId} and follower_id=#{followerId}")
    public Subscribe checkSubscribe(@Param("userId") int userId, @Param("followerId") int followerId);

    //取关
    @Delete("delete from t_subscribe where user_id=#{userId} and follower_id=#{followerId}")
    public int unSubscribe(@Param("userId") int userId, @Param("followerId") int followerId);
}
